package com.cn.why.springclouduser_server.until;

import java.util.HashMap;

/**
 * 公共返回类
 */
public class Result extends HashMap<String,Object> {
    private static final long serialVersionUID = 1L;
    //状态码成功时
    public static Result success(Object obj){
        Result result = new Result();
        result.put("code",200);
        result.put("message","请求成功！");
        result.put("obj",obj);
        return result;
    }

    //失败时
    public static Result error(Object obj){
        Result result = new Result();
        result.put("code",100);
        result.put("message","请求失败！");
        result.put("Obj",obj);
        return result;
    }
}
